public class OrderClosedState implements OrderState {

	public OrderInterface order;
	public ClosedOrder closeOrder;

	public OrderClosedState(OrderInterface orderInterface) {
		this.order = orderInterface;
	}

	@Override
	public String initializeOrder() {
		System.out.println("Order can't be Initialized!");
		return "Order can't be Initialized!";
	}

	@Override
	public String activeOrder() {
		System.out.println("Order can't be activated!");
		return "Order can't be activated!";
	}

	@Override
	public String partialOrder() {
		System.out.println("Order is still in partial state!");
		return "Order is still in partial state!";
	}

	@Override
	public String closeOrder(boolean isOrderFulfilled) {
		order.setState(order.getOrderClosedState());
		if (isOrderFulfilled) {
			closeOrder = new OrderFulfilled();
		} else {
			closeOrder = new OrderCancelled();
		}
		closeOrder.closeOrder();
		return "Order Closed";
	}

}
